package com.geeke.wf.service.common;

import org.springframework.transaction.interceptor.TransactionAspectSupport;


/**
 * 工作流事务处理类
 * @author lys
 * @version 2023-7-13
 */
public class WfTransaction {	
	private Object savepoint = null;


	public WfTransaction() {
		savepoint = TransactionAspectSupport.currentTransactionStatus().createSavepoint();
	}

	/**
	 * 回滚事务
	 */
	public void rollback() {
		if(savepoint != null) {
			TransactionAspectSupport.currentTransactionStatus().rollbackToSavepoint(savepoint);
		}
	}

}
